/**
 * Class that contains all the constant arrays (set of values)
 * 
 * @author remo.lemma@lu.unisi.ch and patrick.zulian@lu.unisi.ch
 */

package ch.unisi.inf.projects.java.uom;

public enum ConstantArrays
{
	/** The common fields for each ItemClass */
	ITEM_COMMON_FIELDS(new String[] { "STRING_NAME", "MULTIMEDIA_PREVIEW", "LISTMULTIMEDIA_MULTIMEDIA" }),
	/** Fields that have not to be displayed */
	ITEM_INVISIBLE_FIELDS(new String[] { "MULTIMEDIA_PREVIEW", "LISTMULTIMEDIA_MULTIMEDIA" }),
	/** Forbidden names for ItemClass */
	ITEM_FORBIDDEN_ITEMCLASS(new String[] { "MULTIMEDIA" } );
	
	/** The array of values */
	private final String[] values;
	
	/**
	 * Contructor
	 * @param values the array of values
	 */
	ConstantArrays (final String[] values)
	{
		this.values = values;
	}
	
	/**
	 * Returns the array of values
	 * @return the array of values
	 */
	public String[] value()
	{
		return this.values;
	}
	
	/**
	 * Checks if the given value is contained
	 * @param value the value to be checked
	 * @return true if the value is contained, false otherwise
	 */
	public boolean contains (final String value)
	{
		for (final String val : values)
		{
			if (val.equals(value))
				return true;
		}
		return false;
	}
}